//
//  BargeInformationViewController.m
//  Globalstone
//
//  Created by 辰领科技 on 16/7/12.
//  Copyright © 2016年 yuf. All rights reserved.
//

#import "BargeInformationViewController.h"

@interface BargeInformationViewController ()
@property (strong, nonatomic) IBOutlet UIView *navView;
@property (strong, nonatomic) IBOutlet UIScrollView *scroview;
@property (strong, nonatomic) IBOutlet UILabel *bargeNumberLabel;//驳船提单号
@property (strong, nonatomic) IBOutlet UILabel *numberLabel;//件数
@property (strong, nonatomic) IBOutlet UILabel *TransferStationLabel;//中转站
@property (strong, nonatomic) IBOutlet UILabel *EstimatedTimeLabel;//预计转驳船时间
@property (strong, nonatomic) IBOutlet UILabel *ToPortLabel;//预计到港时间

@end

@implementation BargeInformationViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self initViewLayout];
    [self getOrderImportTransferDetail];
}

- (void)initViewLayout{
    [self adaptiveViewLayout:self.view];
    [self adaptiveViewLayout:self.navView];
    [self adaptiveViewLayout:self.scroview];
    self.view.backgroundColor = [UIColor colorWithWhite:0.949 alpha:1.000];
    self.scroview.contentSize = flexibleSize(CGSizeMake(320, 505), NO);
}

- (IBAction)back:(id)sender {
    [self backBtn];
}


#pragma mark === 驳船信息
- (void)getOrderImportTransferDetail{
    NSMutableDictionary  *dic=[NSMutableDictionary dictionary];
    [dic setObject:[Common getLoginInfo][Key_User_userId] forKey:@"museId"];
    [dic setObject:[Common getLoginInfo][Key_User_password] forKey:@"musePwd"];
    [dic setObject:[Common getLoginInfo][Key_User_onlineKey] forKey:@"museOnlineTag"];
    NSString * lan = [InternationalControl userLanguage];
    if ([lan isEqualToString:@"en"]) {
        [dic setObject:@"2" forKey:@"language"];
    }else{
        [dic setObject:@"1" forKey:@"language"];
    }
    [dic setObject:_indentId forKey:@"oimpId"];
    
    self.shareApi.delegate=self;
    [self.shareApi  requestOperationWithDic:dic withPath:GS_queryOrderImportTransferDetail withHttpType:@"POST" withTag:GS_GS_queryOrderImportTransferDetail];
}


#pragma   mark---- GetADBanner Request Delegate

-(void)fetchDatabaseFinished:(NSMutableDictionary *)database withTag:(NSInteger)tag{
    
    if (tag==GS_GS_queryOrderImportTransferDetail) {
        
        if (  [[database valueForKey:@"flag"] integerValue]!=1 ) {
            
            [[CWHUDTips sharedInstance]  showTips:[database valueForKey:@"msg"]  withStatus:1 dismissAfter:1.5];
            
        }else  {
            if ([database[@"result"]isEqual:[NSNull null]]) {
                return;
            }
            NSDictionary * dic = database[@"result"][@"ImportTransfer"];
            _TransferStationLabel.text = [NSString stringWithFormat:@"%@",dic[@"oitrPortName"]];
            _EstimatedTimeLabel.text = [NSString stringWithFormat:@"%@",dic[@"oitrTranTimePlan"]];
            _ToPortLabel.text = [NSString stringWithFormat:@"%@",dic[@"oitrTranArriTimePlan"]];
            _bargeNumberLabel.text = [NSString stringWithFormat:@"%@",dic[@"oitrBillNo"]];
            _numberLabel.text = [NSString stringWithFormat:@"%@",dic[@"oitrBillNum"]];

        }
    }
}

-(void)fetchDatabaseFailed:(NSError *)error message:(NSString *)message{
    
    [self dismissWaitDialog];
    
}




@end
